package com.example.contrller.AppVers;

import com.example.biz.AppInfo.AppInfobiz;
import com.example.biz.AppVersion.IAppVersionbiz;
import com.example.pojo.AppInfo;
import com.example.pojo.AppVersion;
import org.omg.PortableInterceptor.INACTIVE;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import java.util.List;

@Controller
@RequestMapping("/vers")
public class AppVersionController {
    @Resource
    private IAppVersionbiz biz;
    @Resource
    private AppInfobiz biz1;

    @RequestMapping("findAddInsert")
    public String findAppVers(AppVersion appVersion){
        biz.findVersion(appVersion);
        return "redirect:/info/infoShow";
    }

    @RequestMapping("findShow/{id}")
    public String findShiLi(@PathVariable("id") Integer id, Model model){
        List<AppInfo> list=biz1.findLishi(id);
        AppInfo app=biz1.findVersId(id);
        model.addAttribute("list",list);
        model.addAttribute("app",app);
        return "dev/LiShiUpdate";
    }

    @RequestMapping("findUpdate")
    public String findUpdate(AppVersion appVersion){
        biz.findUpdate(appVersion);
        return "redirect:/info/infoShow";
    }
}
